<?php
require_once "./conn.php";
// print_r($_POST);

$input = file_get_contents("php://input");
$data = json_decode($input, true);
$id = $data['id'];
$comVal = $data['commentVal'];
$sql = "UPDATE roles Set comment = '" . $comVal . "' WHERE id = " . $id;
// echo $sql;
if ($conn->query($sql)) //判断是否查询成功，

{
    // echo "成功";

    echo json_encode(['Code' => 200, 'Msg' => '修改备注成功', 'Ret' => "True"], JSON_UNESCAPED_UNICODE);


    //成功就跳转

} else {
    echo json_encode(['Code' => 400, 'Msg' => $conn->error, 'Ret' => "False"], JSON_UNESCAPED_UNICODE);
}
